package fhp.hlhj.giantfold.activity.login

import android.app.Activity
import android.content.Intent
import android.os.Build
import android.support.annotation.RequiresApi
import android.transition.Explode
import fhp.hlhj.giantfold.BaseActivity
import fhp.hlhj.giantfold.R
import kotlinx.android.synthetic.main.other_login.*

class OtherLoginAty : BaseActivity() {

    override fun getContentId(): Int {
        return R.layout.other_login
    }

    @RequiresApi(Build.VERSION_CODES.LOLLIPOP)
    override fun initView() {
        window.enterTransition=Explode().setDuration(800)
        window.returnTransition=Explode().setDuration(800)
        window.exitTransition=Explode().setDuration(800)
    }
    override fun initListener() {
        btExit.setOnClickListener {
            finish()
        }
        btPhoneLogin.setOnClickListener {
            val intent = Intent(this, LoginAty::class.java)
            startActivityForResult(intent,1)
        }
    }

    override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
        super.onActivityResult(requestCode, resultCode, data)
        if (resultCode!=Activity.RESULT_OK)return
        if (requestCode==1){
            setResult(-1)
            finish()
        }

    }
}
